<ui:fragment xmlns="http://www.w3.org/1999/xhtml"
			 xmlns:h="http://java.sun.com/jsf/html"
			 xmlns:f="http://java.sun.com/jsf/core"
			 xmlns:ui="http://java.sun.com/jsf/facelets"
			 xmlns:rich="http://richfaces.org/rich"
			 xmlns:a4j="http://richfaces.org/a4j"
			 xmlns:b="http://richfaces.org/sandbox/bootstrap">

	<h:form id="menu_form" class="menu_form">
		<div id="local-nav">
			<ul class="nav nav-list">
				<li id="sites"> <!-- Sites List / begin -->
					<div>
						<span class="toggle" style="background: none;">#{msg['redirect.admin.menu.sites']}</span>
						<h:panelGroup styleClass="more" rendered="#{rdrs.sites.size() > 5}">#{msg['redirect.admin.menu.more']}</h:panelGroup>
					</div>
					<ul>
						<ui:repeat value="#{rdrs.sites}" var="s" varStatus="counter">
							<li class="dropdown #{rdrs.siteName == s.name ? 'active' : ''} #{((rdrs.siteName != s.name) and (counter.index >= 5)) ? 'extra hidden-element' : ''}">
								<a4j:commandLink action="#{rdrs.setSiteName(s.name)}" styleClass="site-link" onclick="$('.edit-group').hide();" render="@form :sum_form :add_form :form-select-node">
									<b:icon value="globe" color="grey" /> #{s.name}
								</a4j:commandLink>
								<span class="dropdown-toggle"><i class="icon-opened icon-gray">#{msg['redirect.admin.menu.actions']}</i></span>
								<ul class="dropdown-menu">
									<li>
										<a4j:mediaOutput element="a" cacheable="false" createContent="#{exporter.exportSite}">
											<a4j:param name="type" value="portal" assignTo="#{exporter.type}" noEscape="true" />
											<a4j:param name="name" value="#{s.name}" assignTo="#{exporter.name}" noEscape="true" />
											<h:outputText value="#{msg['redirect.admin.site.export']}" />
										</a4j:mediaOutput>
									</li>
									<!-- <li class="delete-site separator"><a href="#">Delete Site</a></li> -->
								</ul>
							</li>
						</ui:repeat>
					</ul>
				</li> <!-- Sites List / end -->
				<li id="spaces"> <!-- Spaces List / begin -->
					<div>
						<span class="toggle" style="background: none;">#{msg['redirect.admin.menu.spaces']}</span>
						<h:panelGroup styleClass="more" rendered="#{rdrs.spaces.size() > 5}">#{msg['redirect.admin.menu.more']}</h:panelGroup>
					</div>
					<ul>
						<ui:repeat value="#{rdrs.spaces}" var="s" varStatus="counter">
							<li class="dropdown #{counter.index >= 5 ? 'extra hidden-element' : ''}">
								<a href="#" class="space-link" onclick="event.stopPropagation(); $(this).next('.dropdown-toggle').click(); return false;" title="#{s.name}" >
									<b:icon value="globe" color="grey" /> #{rdrs.getSpaceLabel(s.name)}
								</a>
								<span class="dropdown-toggle"><i class="icon-opened icon-gray">#{msg['redirect.admin.menu.actions']}</i></span>
								<ul class="dropdown-menu">
									<li>
										<a4j:mediaOutput element="a" cacheable="false" createContent="#{exporter.exportSite}">
											<a4j:param name="type" value="group" assignTo="#{exporter.type}" noEscape="true" />
											<a4j:param name="name" value="#{s.name}" assignTo="#{exporter.name}" noEscape="true" />
											<h:outputText value="Export Space" />
										</a4j:mediaOutput>
									</li>
									<!-- <li class="delete-site separator"><a href="#">Delete Space</a></li> -->
								</ul>
							</li>
						</ui:repeat>
					</ul>
				</li> <!-- Sites List / end -->
				<li id="server">
					<ul>
						<li><a href="#modal-import-site" class="import-site data-toggle-modal" id="import-site"><i class="icon-download-alt icon-gray"></i> #{msg['redirect.admin.menu.import']}</a></li>
					</ul>
				</li>
			</ul>
		</div>
	</h:form>
</ui:fragment>